﻿@{
    ViewBag.Title = "Century - Log Viewer";
}
<br />
<h2>Log Viewer</h2>
<br />

@(Html.Telerik().Grid<Century.Models.Common.Log>()
        .Name("Grid")
        .DataKeys(keys => keys.Add(c => c.Id))
        .Columns(columns =>
        {
            columns.Bound(o => o.Id).Hidden(false).Width(55);
            columns.Bound(o => o.Date).Format("{0:dd/MM/yyyy HH:mm}").Width(400).Width(130);
            columns.Bound(o => o.Level);
            columns.Bound(o => o.HostName);
            columns.Bound(o => o.ClientIp);
            columns.Bound(o => o.Logger);
            columns.Bound(o => o.Message).Width(400).Width(300).Hidden();
            columns.Bound(o => o.Exception).Width(500).Width(300);

        })
        .DataBinding(dataBinding => dataBinding.Ajax().Select("_AjaxBinding", "Log"))
        .Pageable(settings => settings.PageSize(20))
        .Sortable(sorting => sorting.OrderBy(sortOrder => sortOrder.Add(o => o.Date).Descending()))
        .Groupable()
        .Filterable()
        .Sortable()
        .Resizable(config =>
        {
          config.Columns(true);
        })
        .Reorderable(config =>
        {
          config.Columns(true);
        })
        .ColumnContextMenu()
)
